# unicode - 2 byte
# utf-8 - 1-6 byte

# transform
a = "hello"
a1 = a.encode()
print(a1)  # b'hello'
print(type(a1))  # <class 'bytes'>
a2 = a1.decode()
print(a2)  # hello
print(type(a2))  # <class 'str'>

st = "这里是大连"
st1 = st.encode("utf-8")
print(st1)  # b'\xe8\xbf\x99\xe5\x9c\xb0\xe6\x98\xaf\xe6\x9d\xad\xe5\xae\xb6'
st2 = st1.decode()
print(st2)  # 这里是大连
print(type(st2))  # <class 'str'>
